package com.freecloud.tomcat.bio.http;

/**
 * @Author: maomao
 * @Date: 2021/8/30 10:05 上午
 */
public abstract class FreeServlet {

    public void service(FreeRequest request, FreeResponse response) throws Exception {
        if ("GET".equalsIgnoreCase(request.getMethod())) {
            doGet(request, response);
        } else {
            doPost(request, response);
        }
    }

    public abstract void doGet(FreeRequest request, FreeResponse response) throws Exception;

    public abstract void doPost(FreeRequest request, FreeResponse response) throws Exception;
}
